import Vue from 'vue'
// import VueRouter from 'vue-router'
import VueRouter from '../../vue-router'
import Index from '@/views/Index.vue'

// 1. 注册路由插件
Vue.use(VueRouter)

// 路由规则
const routes = [
  {
    path: '/',
    name: 'Index',
    component: Index
  },
  {
    path: '/pageA',
    name: 'PageA',
    component: () => import(/* webpackChunkName: "pageA" */ '../views/PageA.vue')
  },
  {
    path: '/pageB',
    name: 'PageB',
    component: () => import(/* webpackChunkName: "PageB" */ '../views/PageB.vue')
  }
]
// 2. 创建 router 对象
const router = new VueRouter({
  routes
})

export default router
